package com.ly.jwt.utils;

/**
 * 返回json调用
 *
 * @Author: 宇
 * @catalogue: com.example.hotelmanagement.utils
 * @Date: 1999/9/9 9:99
 * @Version: 1.0
 */
public class JsonResult<T> {
    /**
     * 返回码
     */
    private String code;
    /**
     * 返回信息
     */
    private String message;
    /**
     * 返回集
     */
    private T data;

    /**
     * 无参构造
     */
    public JsonResult() {
    }

    /**
     * 自定义返回类，查询方法
     *
     * @param data
     */
    public JsonResult(T data) {
        this.code = "200";
        this.message = "操作成功";
        this.data = data;
    }

    /**
     * @param message
     * @param data
     */
    public JsonResult(String message, T data) {
        this.code = "200";
        this.message = message;
        this.data = data;
    }

    /**
     * @param code
     * @param message
     * @param data
     */
    public JsonResult(String code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}